<?php

$info=json_decode($this->input->raw_input_stream,true);
if($this->goods_model->getbytbid($info["id"],$shop["id"],"costco")) die("exist");

$desc="";
$product=array(
    "catid"=>$shop["id"],
    "tbid"=>$info["id"],
    "name"=>$info["name"],
    "thumb"=>serialize([$info["img"]]),
    "source"=>"costco",
    "source_url"=>$info["url"],
    "price"=>$info["price"]+$info["shippingfee"],
    "sales"=>0,
    "desc"=>'<h5>Features:</h5>'.$info["feture"].$info["desc"],
    "tags"=>""
);
$prop=array();

if($info["option"])
{
    $prop["vv"]=$info["option"];
}

$product["option"]=serialize($prop);

if($this->goods_model->create($product)){
    die("ok");
}else{
    die("error");
}